<?php
/**
 * Magento
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Academic Free License (AFL 3.0)
 * that is bundled with this package in the file LICENSE_AFL.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/afl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@magentocommerce.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Magento to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.magentocommerce.com for more information.
 *
 * @category   Varien
 * @package    Varien_Object
 * @copyright  Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
 * @license    http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */
?>
<a name="pear_iframe"></a>

<div id="pear_iframe_container" style="display:none;">
    <input id="pear_iframe_scroll" type="checkbox" checked="checked"/> <label for="pear_iframe_scroll">Auto-scroll console contents</label><br/>
    <iframe id="pear_iframe" name="pear_iframe" src="<?php echo $this->url('empty') ?>" style="width:100%; height:300px;" frameborder="no"></iframe>
</div>

<script type="text/javascript">
function disableInputs(flag)
{
    top.$$('input, select, button').each(function(el){
        if (el.id!='pear_iframe_scroll') el.disabled = flag;
    });
    if (flag) {
        window.onbeforeunload = confirmExit;
    } else {
        window.onbeforeunload = null;
    }
}

function confirmExit()
{
    return "There are PEAR processes running.\nIf you will close the window or navigate away from the page, installation will be interrupted.";
}

function onSubmit()
{
    top.$('pear_iframe_success').style.display = 'none';
    top.$('pear_iframe_failure').style.display = 'none';
    top.$('pear_iframe_container').style.display = '';
    top.location.href = '#pear_iframe';
    return true;
}

function onSuccess()
{
    var div = top.$('pear_iframe_success');
    if (div) {
        top.location.href = top.location.href.replace(/#.*$/, '')+'#pear_iframe_result';
        div.style.display = '';
    }
}

function onFailure()
{
    var div = top.$('pear_iframe_failure');
    if (div) {
        top.location.href = top.location.href.replace(/#.*$/, '')+'#pear_iframe_result';
        div.style.display = '';
    }
}
</script>
